<script setup>
import { userReguserInfo } from '@/api/ReguserView'
import { ref } from 'vue'
import '@/assets/formstyle.css'
const loginForm = ref({
  username: '',
  password: '',
  schoolID: '',
  phone_number: '',
})

const setFromdata = () => {
  userReguserInfo(loginForm.value)
    .then((res) => {
      console.log(res)
    })
    .catch((err) => {
      console.log(err)
    })
}
</script>
<template>
  <div class="about">
    <div class="theform">
      <div class="form-content">
        <h1>用户注册</h1>
        <div>
          <p class="userInput">
            <span>用户名：</span
            ><input
              type="text"
              v-model="loginForm.username"
            />
          </p>
          <p class="userInput">
            <span>密码：</span
            ><input
              type="text"
              v-model="loginForm.password"
            />
          </p>
          <p class="userInput">
            <span>学号：</span
            ><input
              type="text"
              v-model="loginForm.schoolID"
            />
          </p>
          <p class="userInput">
            <span>手机号：</span
            ><input
              type="text"
              v-model="loginForm.phone_number"
            />
          </p>
        </div>
        <button @click="setFromdata">提交</button>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.about {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #165047;

  .userInput {
    width: 80%;
    display: flex;

    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    margin-bottom: 1rem;

    span {
      width: 26%;
      text-align: right;
    }

    input {
      width: 85%;
    }
  }
}
</style>
